' This program exported from BASIC Anywhere Machine (Version [5.2.3].[2023.09.17.17.11]) on 2023.09.25 at 01:05 (Coordinated Universal Time)
' 🟠🟠🟠DEVELOPMENT VERSION OF BASIC ANYWHERE MACHINE
' QB64 Phoenix Edition program by Dav, as found at https://qb64phoenix.com/forum/showthread.php?tid=1989&pid=19639#pid19639
' BASIC Anywhere Machine port by Charlie Veniot
' 🛑 Although BAM supports arrays, BAM does not support REDIM to reset and resize arrays
' Array usage has been replaced with the use of the BAM "map" facility for key-value pairs.
' 🛑 BAM programs do not work with virtual keyboards on touch devices
' The "Enter" key to generate a new wheel replaced with mouseclick/touch of the screen
Screen _NewImage(800, 600, 32)
Dim points, i, a, b, clr&, w 'for qbjs to use
'generate starting values
points = 9 + Int(Rnd * 10) 'num of points to use
dim as string px = "px", py = "py"
clr& = _RGB(Rnd * 255, Rnd * 255, Rnd * 255) 'make random color
Do
Cls
'compute x/y pos
For i = 0 To points
_mapset( px+i, (_Width / 2) + (Sin((Timer * .5) * (i / points)) * _Height / 2) )
_mapset( py+i, (_Height / 2) + (Cos((Timer * .5) * (i / points)) * _Height / 2) )
Next
'do the points
For a = 0 To points
For b = 0 To points
Line (_mapget(px+a), _mapget(py+a))-(_mapget(px+b), _mapget(py+b)), clr&
For w = 1 To (points / 2) Step .36
Circle (_mapget(px+a), _mapget(py+a)), w, clr&
Next
Next
Next
Locate 1, 1: Print "Click/touch the screen for new wheel";
Locate 2, 1: Print points; " points";
_delay 0.01
If _MOUSEBUTTON Then
WHILE _MOUSEBUTTON : WEND
points = 9 + Int(Rnd * 10) 'num of points to use
clr& = _RGB(Rnd * 255, Rnd * 255, Rnd * 255) 'random color
End If
Loop